<?php
header("content-type:text/html;charset=utf-8");
include("./conn/conn.php");
session_start();
$time=date("Y-m-d");
$content=$_POST['vpl'];
$na=$_SESSION['namea'];
$id=$_SESSION['id'];
if($_SESSION['name']!=""){
$sql="insert into tb_lyxt(people,time,content,id_room,state) values('$na','$time','$content',$id,2)";
$result=mysqli_query($link,$sql);
var_dump($result);
if($result){
echo("<script>alert('评论成功，需要审核！');window.location.href='zkly.php';</script>");
	}else{
		echo("<script>alert('评论失败！');history.go(-1);</script>");
		}
}else{
	echo("<script>alert('请登陆后评论！');window.location.href='dlym.php';</script>");
	}
?>